import { WEBSOCKET, WEBSOCKETS } from "@sker/core";
import { DependencyContainer, container } from "tsyringe";

export default async (data: { type: string, paylaod: any, injector: DependencyContainer }) => {
    const { type, paylaod, injector } = data;
    const socket = injector.resolve(WEBSOCKET)
    if (type === 'connection') {
        const websockets = container.resolve(WEBSOCKETS)
        const keys = [...websockets.keys()]
        socket.send(JSON.stringify({ msg: 'connect success', keys }))
    }
}
